#ifndef LOGIC_H
#define LOGIC_H
#ifdef __cplusplus

extern "C"{

#endif
#include "stm32l1xx_hal.h"
#include "cmsis_os.h"

#define RS485 
#define ST_LIMIT_VALUE 2000
typedef enum adcState
{
    ADC_WORK_e = 0,
    ADC_FINISH_e,
    ADC_WAIT_e
}adcState;
extern UART_HandleTypeDef huart1;
extern ADC_HandleTypeDef hadc;
extern IWDG_HandleTypeDef hiwdg;

extern osSemaphoreId semAdcStartHandle;
extern osSemaphoreId semAdcFinishHandle;
extern osSemaphoreId semUartHandle;


extern uint8_t u1Len;
extern adcState gAdcState;
extern uint8_t u1Buff[256];
extern uint16_t adc_value[1000];
extern uint16_t adc_store[500];
extern uint8_t startFlag;
extern uint8_t lastIoState ; //default up
extern uint16_t lastValue;
extern uint16_t gAdcTimeout;

extern uint16_t gAdcCount;
extern uint8_t gSrcAddr;
extern uint8_t gAdcWorkFlag;
void Scan_MulBtn(void);
#ifdef __cplusplus

};

#endif
#endif